import request from '@/utils/request'
export const getEmployeeList = (params) => {
  return request.get('/sys/user', {
    params
  })
}

export const exportExcel = () => {
  return request.get('/sys/user/export', {
    responseType: 'blob' // 指定响应的数据类型 - 二进制流
  })
}

export const getTemplate = () => {
  return request.get('/sys/user/import/template', {
    responseType: 'blob'
  })
}

export const uploadExcel = (data) => {
  return request.post('/sys/user/import', data)
}

export const addEmployee = (data) => {
  return request.post('/sys/user', data)
}

export const getEmployeeDetail = (id) => {
  return request.get(`/sys/user/${id}`)
}

export const updateEmployee = (data) => {
  return request.put(`/sys/user/${data.id}`, data)
}

export const assignRoles = (data) => {
  return request.put('/sys/user/assignRoles', data)
}

